/*
 *  This file is part of the SIRIUS libraries for analyzing MS and MS/MS data
 *
 *  Copyright (C) 2024 Bright Giant GmbH
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along with SIRIUS.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 *  https://openapi-generator.tech
 *  Do not edit the class manually.
 */


package io.sirius.ms.sdk.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.sirius.ms.sdk.model.ParentPeak;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * PeakAnnotation
 */
@JsonPropertyOrder({
  PeakAnnotation.JSON_PROPERTY_FRAGMENT_ID,
  PeakAnnotation.JSON_PROPERTY_MOLECULAR_FORMULA,
  PeakAnnotation.JSON_PROPERTY_ADDUCT,
  PeakAnnotation.JSON_PROPERTY_EXACT_MASS,
  PeakAnnotation.JSON_PROPERTY_MASS_DEVIATION_MZ,
  PeakAnnotation.JSON_PROPERTY_MASS_DEVIATION_PPM,
  PeakAnnotation.JSON_PROPERTY_RECALIBRATED_MASS_DEVIATION_MZ,
  PeakAnnotation.JSON_PROPERTY_RECALIBRATED_MASS_DEVIATION_PPM,
  PeakAnnotation.JSON_PROPERTY_PARENT_PEAK,
  PeakAnnotation.JSON_PROPERTY_SUBSTRUCTURE_ATOMS,
  PeakAnnotation.JSON_PROPERTY_SUBSTRUCTURE_BONDS,
  PeakAnnotation.JSON_PROPERTY_SUBSTRUCTURE_BONDS_CUT,
  PeakAnnotation.JSON_PROPERTY_SUBSTRUCTURE_SCORE,
  PeakAnnotation.JSON_PROPERTY_HYDROGEN_REARRANGEMENTS
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0")
public class PeakAnnotation {
  public static final String JSON_PROPERTY_FRAGMENT_ID = "fragmentId";
  @jakarta.annotation.Nonnull
  private Integer fragmentId;

  public static final String JSON_PROPERTY_MOLECULAR_FORMULA = "molecularFormula";
  @jakarta.annotation.Nullable
  private String molecularFormula;

  public static final String JSON_PROPERTY_ADDUCT = "adduct";
  @jakarta.annotation.Nullable
  private String adduct;

  public static final String JSON_PROPERTY_EXACT_MASS = "exactMass";
  @jakarta.annotation.Nullable
  private Double exactMass;

  public static final String JSON_PROPERTY_MASS_DEVIATION_MZ = "massDeviationMz";
  @jakarta.annotation.Nullable
  private Double massDeviationMz;

  public static final String JSON_PROPERTY_MASS_DEVIATION_PPM = "massDeviationPpm";
  @jakarta.annotation.Nullable
  private Double massDeviationPpm;

  public static final String JSON_PROPERTY_RECALIBRATED_MASS_DEVIATION_MZ = "recalibratedMassDeviationMz";
  @jakarta.annotation.Nullable
  private Double recalibratedMassDeviationMz;

  public static final String JSON_PROPERTY_RECALIBRATED_MASS_DEVIATION_PPM = "recalibratedMassDeviationPpm";
  @jakarta.annotation.Nullable
  private Double recalibratedMassDeviationPpm;

  public static final String JSON_PROPERTY_PARENT_PEAK = "parentPeak";
  @jakarta.annotation.Nullable
  private ParentPeak parentPeak;

  public static final String JSON_PROPERTY_SUBSTRUCTURE_ATOMS = "substructureAtoms";
  @jakarta.annotation.Nullable
  private List<Integer> substructureAtoms;

  public static final String JSON_PROPERTY_SUBSTRUCTURE_BONDS = "substructureBonds";
  @jakarta.annotation.Nullable
  private List<Integer> substructureBonds;

  public static final String JSON_PROPERTY_SUBSTRUCTURE_BONDS_CUT = "substructureBondsCut";
  @jakarta.annotation.Nullable
  private List<Integer> substructureBondsCut;

  public static final String JSON_PROPERTY_SUBSTRUCTURE_SCORE = "substructureScore";
  @jakarta.annotation.Nullable
  private Float substructureScore;

  public static final String JSON_PROPERTY_HYDROGEN_REARRANGEMENTS = "hydrogenRearrangements";
  @jakarta.annotation.Nullable
  private Integer hydrogenRearrangements;

  public PeakAnnotation() {
  }

  public PeakAnnotation fragmentId(@jakarta.annotation.Nonnull Integer fragmentId) {
    
    this.fragmentId = fragmentId;
    return this;
  }

  /**
   * Identifier of the peak/fragment. Can be used to map fragments and peaks  among fragmentation trees and spectra.
   * @return fragmentId
   */
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_FRAGMENT_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Integer getFragmentId() {
    return fragmentId;
  }


  @JsonProperty(JSON_PROPERTY_FRAGMENT_ID)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setFragmentId(@jakarta.annotation.Nonnull Integer fragmentId) {
    this.fragmentId = fragmentId;
  }

  public PeakAnnotation molecularFormula(@jakarta.annotation.Nullable String molecularFormula) {
    
    this.molecularFormula = molecularFormula;
    return this;
  }

  /**
   * Molecular formula that has been annotated to this peak
   * @return molecularFormula
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MOLECULAR_FORMULA)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getMolecularFormula() {
    return molecularFormula;
  }


  @JsonProperty(JSON_PROPERTY_MOLECULAR_FORMULA)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMolecularFormula(@jakarta.annotation.Nullable String molecularFormula) {
    this.molecularFormula = molecularFormula;
  }

  public PeakAnnotation adduct(@jakarta.annotation.Nullable String adduct) {
    
    this.adduct = adduct;
    return this;
  }

  /**
   * Adduct that has been annotated to this peak
   * @return adduct
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ADDUCT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getAdduct() {
    return adduct;
  }


  @JsonProperty(JSON_PROPERTY_ADDUCT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setAdduct(@jakarta.annotation.Nullable String adduct) {
    this.adduct = adduct;
  }

  public PeakAnnotation exactMass(@jakarta.annotation.Nullable Double exactMass) {
    
    this.exactMass = exactMass;
    return this;
  }

  /**
   * Exact mass of the annotated molecular formula and adduct
   * @return exactMass
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_EXACT_MASS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getExactMass() {
    return exactMass;
  }


  @JsonProperty(JSON_PROPERTY_EXACT_MASS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setExactMass(@jakarta.annotation.Nullable Double exactMass) {
    this.exactMass = exactMass;
  }

  public PeakAnnotation massDeviationMz(@jakarta.annotation.Nullable Double massDeviationMz) {
    
    this.massDeviationMz = massDeviationMz;
    return this;
  }

  /**
   * Absolute mass deviation of the exact mass to the measured peak mass in mDa
   * @return massDeviationMz
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MASS_DEVIATION_MZ)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getMassDeviationMz() {
    return massDeviationMz;
  }


  @JsonProperty(JSON_PROPERTY_MASS_DEVIATION_MZ)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMassDeviationMz(@jakarta.annotation.Nullable Double massDeviationMz) {
    this.massDeviationMz = massDeviationMz;
  }

  public PeakAnnotation massDeviationPpm(@jakarta.annotation.Nullable Double massDeviationPpm) {
    
    this.massDeviationPpm = massDeviationPpm;
    return this;
  }

  /**
   * Relative mass deviation of the exact mass to the measured peak mass in ppm
   * @return massDeviationPpm
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MASS_DEVIATION_PPM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getMassDeviationPpm() {
    return massDeviationPpm;
  }


  @JsonProperty(JSON_PROPERTY_MASS_DEVIATION_PPM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMassDeviationPpm(@jakarta.annotation.Nullable Double massDeviationPpm) {
    this.massDeviationPpm = massDeviationPpm;
  }

  public PeakAnnotation recalibratedMassDeviationMz(@jakarta.annotation.Nullable Double recalibratedMassDeviationMz) {
    
    this.recalibratedMassDeviationMz = recalibratedMassDeviationMz;
    return this;
  }

  /**
   * Absolute mass deviation of the exact mass to the recalibrated peak mass in mDa
   * @return recalibratedMassDeviationMz
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_RECALIBRATED_MASS_DEVIATION_MZ)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getRecalibratedMassDeviationMz() {
    return recalibratedMassDeviationMz;
  }


  @JsonProperty(JSON_PROPERTY_RECALIBRATED_MASS_DEVIATION_MZ)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setRecalibratedMassDeviationMz(@jakarta.annotation.Nullable Double recalibratedMassDeviationMz) {
    this.recalibratedMassDeviationMz = recalibratedMassDeviationMz;
  }

  public PeakAnnotation recalibratedMassDeviationPpm(@jakarta.annotation.Nullable Double recalibratedMassDeviationPpm) {
    
    this.recalibratedMassDeviationPpm = recalibratedMassDeviationPpm;
    return this;
  }

  /**
   * Relative mass deviation of the exact mass to the recalibrated peak mass in ppm
   * @return recalibratedMassDeviationPpm
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_RECALIBRATED_MASS_DEVIATION_PPM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getRecalibratedMassDeviationPpm() {
    return recalibratedMassDeviationPpm;
  }


  @JsonProperty(JSON_PROPERTY_RECALIBRATED_MASS_DEVIATION_PPM)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setRecalibratedMassDeviationPpm(@jakarta.annotation.Nullable Double recalibratedMassDeviationPpm) {
    this.recalibratedMassDeviationPpm = recalibratedMassDeviationPpm;
  }

  public PeakAnnotation parentPeak(@jakarta.annotation.Nullable ParentPeak parentPeak) {
    
    this.parentPeak = parentPeak;
    return this;
  }

  /**
   * Get parentPeak
   * @return parentPeak
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_PARENT_PEAK)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public ParentPeak getParentPeak() {
    return parentPeak;
  }


  @JsonProperty(JSON_PROPERTY_PARENT_PEAK)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setParentPeak(@jakarta.annotation.Nullable ParentPeak parentPeak) {
    this.parentPeak = parentPeak;
  }

  public PeakAnnotation substructureAtoms(@jakarta.annotation.Nullable List<Integer> substructureAtoms) {
    
    this.substructureAtoms = substructureAtoms;
    return this;
  }

  public PeakAnnotation addSubstructureAtomsItem(Integer substructureAtomsItem) {
    if (this.substructureAtoms == null) {
      this.substructureAtoms = new ArrayList<>();
    }
    this.substructureAtoms.add(substructureAtomsItem);
    return this;
  }

  /**
   * EXPERIMENTAL: This field is experimental and may be changed (or even removed) without notice until it is declared stable.   Array/List of indices of the atoms of the structure candidate that are part of this fragments substructure  (highlighted atoms)
   * @return substructureAtoms
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_SUBSTRUCTURE_ATOMS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<Integer> getSubstructureAtoms() {
    return substructureAtoms;
  }


  @JsonProperty(JSON_PROPERTY_SUBSTRUCTURE_ATOMS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSubstructureAtoms(@jakarta.annotation.Nullable List<Integer> substructureAtoms) {
    this.substructureAtoms = substructureAtoms;
  }

  public PeakAnnotation substructureBonds(@jakarta.annotation.Nullable List<Integer> substructureBonds) {
    
    this.substructureBonds = substructureBonds;
    return this;
  }

  public PeakAnnotation addSubstructureBondsItem(Integer substructureBondsItem) {
    if (this.substructureBonds == null) {
      this.substructureBonds = new ArrayList<>();
    }
    this.substructureBonds.add(substructureBondsItem);
    return this;
  }

  /**
   * EXPERIMENTAL: This field is experimental and may be changed (or even removed) without notice until it is declared stable.   Array/List of indices of the bonds of the structure candidate that are part of this fragments substructure  (highlighted bonds)   Null if substructure annotation not available or not requested.
   * @return substructureBonds
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_SUBSTRUCTURE_BONDS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<Integer> getSubstructureBonds() {
    return substructureBonds;
  }


  @JsonProperty(JSON_PROPERTY_SUBSTRUCTURE_BONDS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSubstructureBonds(@jakarta.annotation.Nullable List<Integer> substructureBonds) {
    this.substructureBonds = substructureBonds;
  }

  public PeakAnnotation substructureBondsCut(@jakarta.annotation.Nullable List<Integer> substructureBondsCut) {
    
    this.substructureBondsCut = substructureBondsCut;
    return this;
  }

  public PeakAnnotation addSubstructureBondsCutItem(Integer substructureBondsCutItem) {
    if (this.substructureBondsCut == null) {
      this.substructureBondsCut = new ArrayList<>();
    }
    this.substructureBondsCut.add(substructureBondsCutItem);
    return this;
  }

  /**
   * EXPERIMENTAL: This field is experimental and may be changed (or even removed) without notice until it is declared stable.   Array/List of indices of the bonds of the structure candidate that need to be cut to produce this fragments  substructure (highlighted cutted bonds).   Null if substructure annotation not available or not requested.
   * @return substructureBondsCut
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_SUBSTRUCTURE_BONDS_CUT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<Integer> getSubstructureBondsCut() {
    return substructureBondsCut;
  }


  @JsonProperty(JSON_PROPERTY_SUBSTRUCTURE_BONDS_CUT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSubstructureBondsCut(@jakarta.annotation.Nullable List<Integer> substructureBondsCut) {
    this.substructureBondsCut = substructureBondsCut;
  }

  public PeakAnnotation substructureScore(@jakarta.annotation.Nullable Float substructureScore) {
    
    this.substructureScore = substructureScore;
    return this;
  }

  /**
   * EXPERIMENTAL: This field is experimental and may be changed (or even removed) without notice until it is declared stable.   This score roughly reflects the probability of this fragment forming.   This is the score of the path from root to this node which has the maximal score or \&quot;profit\&quot;.  The score of a path is equal to the sum of scores of its contained fragments and edges.  Note: Refers to &#39;totalScore&#39; in CombinatorialNode   Null if substructure annotation not available or not requested.
   * @return substructureScore
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_SUBSTRUCTURE_SCORE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Float getSubstructureScore() {
    return substructureScore;
  }


  @JsonProperty(JSON_PROPERTY_SUBSTRUCTURE_SCORE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSubstructureScore(@jakarta.annotation.Nullable Float substructureScore) {
    this.substructureScore = substructureScore;
  }

  public PeakAnnotation hydrogenRearrangements(@jakarta.annotation.Nullable Integer hydrogenRearrangements) {
    
    this.hydrogenRearrangements = hydrogenRearrangements;
    return this;
  }

  /**
   * EXPERIMENTAL: This field is experimental and may be changed (or even removed) without notice until it is declared stable.   Number of hydrogens rearrangements needed to match the substructure to the fragment formula.   Null if substructure annotation not available or not requested.
   * @return hydrogenRearrangements
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_HYDROGEN_REARRANGEMENTS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getHydrogenRearrangements() {
    return hydrogenRearrangements;
  }


  @JsonProperty(JSON_PROPERTY_HYDROGEN_REARRANGEMENTS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setHydrogenRearrangements(@jakarta.annotation.Nullable Integer hydrogenRearrangements) {
    this.hydrogenRearrangements = hydrogenRearrangements;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PeakAnnotation peakAnnotation = (PeakAnnotation) o;
    return Objects.equals(this.fragmentId, peakAnnotation.fragmentId) &&
        Objects.equals(this.molecularFormula, peakAnnotation.molecularFormula) &&
        Objects.equals(this.adduct, peakAnnotation.adduct) &&
        Objects.equals(this.exactMass, peakAnnotation.exactMass) &&
        Objects.equals(this.massDeviationMz, peakAnnotation.massDeviationMz) &&
        Objects.equals(this.massDeviationPpm, peakAnnotation.massDeviationPpm) &&
        Objects.equals(this.recalibratedMassDeviationMz, peakAnnotation.recalibratedMassDeviationMz) &&
        Objects.equals(this.recalibratedMassDeviationPpm, peakAnnotation.recalibratedMassDeviationPpm) &&
        Objects.equals(this.parentPeak, peakAnnotation.parentPeak) &&
        Objects.equals(this.substructureAtoms, peakAnnotation.substructureAtoms) &&
        Objects.equals(this.substructureBonds, peakAnnotation.substructureBonds) &&
        Objects.equals(this.substructureBondsCut, peakAnnotation.substructureBondsCut) &&
        Objects.equals(this.substructureScore, peakAnnotation.substructureScore) &&
        Objects.equals(this.hydrogenRearrangements, peakAnnotation.hydrogenRearrangements);
  }

  @Override
  public int hashCode() {
    return Objects.hash(fragmentId, molecularFormula, adduct, exactMass, massDeviationMz, massDeviationPpm, recalibratedMassDeviationMz, recalibratedMassDeviationPpm, parentPeak, substructureAtoms, substructureBonds, substructureBondsCut, substructureScore, hydrogenRearrangements);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PeakAnnotation {\n");
    sb.append("    fragmentId: ").append(toIndentedString(fragmentId)).append("\n");
    sb.append("    molecularFormula: ").append(toIndentedString(molecularFormula)).append("\n");
    sb.append("    adduct: ").append(toIndentedString(adduct)).append("\n");
    sb.append("    exactMass: ").append(toIndentedString(exactMass)).append("\n");
    sb.append("    massDeviationMz: ").append(toIndentedString(massDeviationMz)).append("\n");
    sb.append("    massDeviationPpm: ").append(toIndentedString(massDeviationPpm)).append("\n");
    sb.append("    recalibratedMassDeviationMz: ").append(toIndentedString(recalibratedMassDeviationMz)).append("\n");
    sb.append("    recalibratedMassDeviationPpm: ").append(toIndentedString(recalibratedMassDeviationPpm)).append("\n");
    sb.append("    parentPeak: ").append(toIndentedString(parentPeak)).append("\n");
    sb.append("    substructureAtoms: ").append(toIndentedString(substructureAtoms)).append("\n");
    sb.append("    substructureBonds: ").append(toIndentedString(substructureBonds)).append("\n");
    sb.append("    substructureBondsCut: ").append(toIndentedString(substructureBondsCut)).append("\n");
    sb.append("    substructureScore: ").append(toIndentedString(substructureScore)).append("\n");
    sb.append("    hydrogenRearrangements: ").append(toIndentedString(hydrogenRearrangements)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

